<template>
  <!-- 7-17新增 当hasButton值为false时且当hasTableButton为true时不显示按钮 -->
  <div class="button-group" v-if="hasButton == true && hasTableButton != true">
    <el-button plain @click="onReset">清空</el-button>
    <el-button type="primary" @click="onSearch">查询</el-button>
  </div>
</template>

<script lang="ts" setup>

defineProps<{ isToggle: boolean; isCollapse: boolean; hasButton: boolean; hasTableButton: boolean }>()
const emits = defineEmits(['on-search', 'on-reset'])

/**
 * 点击查询
 */
const onSearch = () => {
  emits('on-search')
}

/**
 * 点击重置
 */
const onReset = () => {
  emits('on-reset')
}
</script>

<style lang="less" scoped>
.button-group {
  text-align: right;
  align-self: flex-end;
  margin-bottom: 24px;
  .toggle-btn {
    cursor: pointer;
    margin-left: 8px;
    color: #2d8cf0;
    user-select: none;
  }
}
</style>
